/*
gulp.task
gulp.src = poin to the file to use
gulp.dest = point to the folder of destination
gulp.watch = watch files and folders for changes
*/

//variables
var url = 'http://localhost:8012/photodron/';
    gulp = require('gulp');
    browserSync = require('browser-sync').create();

//watch for files on dev server
gulp.task('dev', function() {
    browserSync.init({
        files: [{
            match: [
                //php files
                './**/*.php', 

            ],
            fn: function (event, file) {
                this.reload()
            }
        } ],
        proxy: url, 
        port: 3000,
        // use public url? 
        // tunnel: true,
        // tunnel: url,
        injectChanges: true 
    });

    //watch styles
    gulp.watch("style.css").on('change', browserSync.reload);
    gulp.watch("css/*.css").on('change', browserSync.reload);
    gulp.watch("inc/**/*.css").on('change', browserSync.reload);
    gulp.watch("class/**/*.css").on('change', browserSync.reload);

    //watch javascript
    gulp.watch("js/*.js").on('change', browserSync.reload);
    gulp.watch("inc/**/*.js").on('change', browserSync.reload);
    gulp.watch("class/**/*.js").on('change', browserSync.reload);

});
